var website = require('./websiteHandler');
var apiRouter = require('./apiRouter');
var standardErrors = require('./standardErrors');

function route(app) {
	app.get('/', function(req, res) {
		website.index(req, res);
	});

	app.get('/login', function(req, res) {
		website.login(req, res);
	});

	app.get('/displayNotes', function(req, res) {
		website.displayNotes(req, res);
	});

	app.get('/api/:api_controller', function(req, res) {
		apiRouter.apiRoute(req, res);
	});

	app.get('/api/note/:note_controller', function(req, res) {
		apiRouter.noteApiRoute(req, res);
	});

	app.use(function(req, res, next) {
		standardErrors.error404(res);
	});
}
exports.route = route;